﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <script src="lib/upload/jquery-1.11.3.min.js"></script>
    <script src="lib/upload/jquery.ui.widget.js"></script>
    <script src="lib/upload/jquery.fileupload.js"></script>
    <script src="lib/upload/jquery.fileupload-process.js"></script>
</head>
<body>
    <input type="file" id="file" name="file" style="display:none" multiple />
    <input type="button" id="selectfile" value="上传" />
    <script type="text/javascript">

        $("#file").fileupload({
            url: "/Upload/Index",
            dataType: 'json',
        }).bind("add", function (e, data) {
            //添加 这里可以简单验证文件类型和大小
            data.submit();
        }).bind("fileuploadsubmit", function (e, data) {
            //提交  附加了上传文件需要使用的配置名称
            //data.formData = { configName: 'DealerImage' };
        }).bind("fileuploadprogress", function (e, data) {
            //进度条

        }).bind("fileuploaddone", function (e, data) {

        }).bind("fileuploadfail", function (a, b, c) {

        });

        $("#selectfile").click(function () {
            $("#file").click();
        });
    </script>

</body>
</html>